package cn.tedu.springmvc;

import cn.tedu.springmvc.config.SpringConfig;
import cn.tedu.springmvc.config.SpringMvcConfig;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 *Spring MVC项目的初始化类
 */
public class SpringMvcInitializer extends AbstractAnnotationConfigDispatcherServletInitializer{


    @Override
    protected Class<?>[] getRootConfigClasses() {
        //返回自行配置Spring相关内容的类
        return new Class[]{SpringConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        //返回自行配置Spring MVC相关内容的类
        return new Class[]{SpringMvcConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        //返回哪些路径是由Spring MVC框架处理
        return new String[]{"*.do"};
    }
}
